<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>新增结算区域</title>
</head>
<body>
<div ng-app="SettlementRegionAddApp" ng-controller="SettlementRegionAddCtrl">
        <ui-form key="SettlementRegionAdd" column="2">

            <ui-form-input name="name" label="别名"></ui-form-input>
            <ui-form-select name="level" label="区域类型">
                <%--0一类区域 1二类区域 2三类区域--%>
                <option value="0">一类区域</option>
                <option value="1">二类区域</option>
                <option value="2">三类区域</option>
            </ui-form-select>

            <%--<ui-form-region label="发货地的城市编码" p-name="fromProvince" c-name="fromCode"></ui-form-region>--%>

            <%--<ui-form-select-remote label="角色" url="/role/listMenu" value-name="code" text-name="url"></ui-form-select-remote>--%>
            <ui-form-region label="目的地" p-name="toProvince" c-name="toCity" a-name="toCounty"></ui-form-region>

        </ui-form>
</div>
<script>
    angular.module('SettlementRegionAddApp', ['ui.form']);
    angular.module('SettlementRegionAddApp').controller('SettlementRegionAddCtrl', function ($scope) {
        $scope.$on('ui.form.submit',function (event,param) {
            $.ajax({
                url:"rule/settlementregion/add",
                type:"post",
                data:param
            }).done(function (result) {
                if(result.code=='0000'){
                    toastr.success("新增成功");
                    setTimeout(function () {
                        window.close();
                    },1500);
                }else{
                    toastr.error(result.msg);
                }
            }).fail(function (err) {
                
            });
        })
    });
</script>
</body>
</html>
